package com.wc.AlgoOJ.MA0010_互质数个数2;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2024/3/30 17:45
 * @description http://43.138.190.70:8888/p/MA0010
 */
public class Main {
    static int M = 10000010;
    static int[] primes = new int[M / 10];
    static int[] phi = new int[M];
    static boolean[] st = new boolean[M];
    static int idx = 0;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int l = sc.nextInt();
        int r = sc.nextInt();
        long res = 0;

        for (int i = 1; i <= r; i++) phi[i] = i;

        // 质数筛，ola筛，i筛
        for (int i = 2; i <= r; i++) {
            if (phi[i] == i) {
                for (int j = i; j <= r; j += i) {
                    phi[j] = phi[j] / i * (i - 1);
                }
            }
        }

        for (int i = l; i <= r; i++) {
            res += phi[i];
        }
        System.out.println(res);
    }
}